package cqrtplm.service.impl;

import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONObject;
import com.hustcad.plm.basic.entity.BaseObject;
import com.hustcad.plm.pdm.defaultvalue.TyplmDefaultValueService;
import com.hustcad.plm.pdm.ec.module.dto.ECObjData;
import com.hustcad.plm.pdm.flowbusiness.model.entity.FlowChgFormView;
import com.hustcad.plm.pdm.flowbusiness.model.entity.FlowObject;
import com.hustcad.plm.pdm.flowbusiness.model.entity.FlowObjectPackageLink;
import com.hustcad.plm.pdm.flowbusiness.model.entity.WorkFlowObjectPackage;
import com.hustcad.plm.pdm.flowbusiness.model.vo.FlowObjectStructuredParamVO;
import com.hustcad.plm.pdm.flowbusiness.service.TyplmWorkFlowObjectPackageService;
import com.hustcad.plm.pdm.folder.service.TyplmSubFolderLinkService;
import com.hustcad.plm.pdm.iba.model.dto.SaveObjIBADTO;
import com.hustcad.plm.pdm.iba.service.TyplmAttributeValueService;
import com.hustcad.plm.pdm.middle.partbom.service.TyplmPdmPartService;
import com.hustcad.plm.pdm.partbom.service.TyplmPartService;
import com.hustcad.plm.pdm.partbom.vo.TyPartAllVO;
import com.hustcad.plm.pdm.type.service.TyplmTypeService;
import com.hustcad.plm.pdm.workflow.model.entity.WorkFlowContainerView;
import com.hustcad.plm.pdm.workflow.service.TyplmWorkFlowContainerService;
import com.ty.basic.constant.TableTypeConstrant;
import com.ty.basic.dto.constraint.IbaDTO;
import com.ty.basic.entity.CTyEntityBaseDO;
import com.ty.basic.entity.part.PartDO;
import com.ty.basic.vo.AttributeVO;
import cqrtplm.constant.RTErrorCodeEnum;
import cqrtplm.constant.RTPlmConstant;
import cqrtplm.dto.DesignDerivationDTO;
import cqrtplm.dto.GenerateDescriptionRuleDto;
import cqrtplm.dto.PartFeatureDTO;
import cqrtplm.mapper.RTPartMapper;
import cqrtplm.mapper.RTTypeClassMapper;
import cqrtplm.mapper.StoragePlanningMapper;
import cqrtplm.service.CodeSequenceService;
import cqrtplm.service.ObjectStorageService;
import cqrtplm.service.RTAttributeCardService;
import cqrtplm.service.RTPartService;
import cqrtplm.vo.DescriptionVO;
import cqrtplm.vo.FeatureVO;
import cqrtplm.vo.PartFeatureVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.math.BigInteger;
import java.util.*;
import java.util.stream.Collectors;

@Service
@Slf4j
public class RTPartServiceImpl implements RTPartService {
    private static final String MATERIAL_TYPE = "ty.inteplm.part.CTyPart|MaterialCode";

    @Resource
    private RTPartMapper rtPartMapper;
    @Resource
    private TyplmPartService typlmPartService;
    @Resource
    private TyplmAttributeValueService typlmAttributeValueService;
    @Resource
    private TyplmWorkFlowContainerService typlmWorkFlowContainerService;
    @Resource
    private CodeSequenceService codeSequenceService;
    @Resource
    private RTAttributeCardService rtAttributeCardService;
    @Resource
    private TyplmTypeService typlmTypeService;
    @Resource
    private TyplmDefaultValueService typlmDefaultValueService;
    @Resource
    private TyplmPdmPartService typlmPdmPartService;
    @Resource
    private RTTypeClassMapper rtTypeClassMapper;
    @Resource
    private ObjectStorageService objectStorageService;
    @Resource
    private StoragePlanningMapper storagePlanningMapper;
    @Resource
    private TyplmSubFolderLinkService typlmSubFolderLinkService;
    @Resource
    private TyplmWorkFlowObjectPackageService typlmWorkFlowObjectPackageService;

    @Override
    public PartFeatureDTO getPartIba(PartFeatureVO vo) {
        PartFeatureDTO dto = new PartFeatureDTO();
        List<FeatureVO> featureVOS = vo.getFeatures();
        if(CollUtil.isEmpty(featureVOS)) {
            dto.setResult("false");
            dto.setSuccess("false");
            dto.setMessageBoxicon("参数不合法");
            dto.setTime(String.valueOf(new Date()));
            return dto;
        }
        List<JSONObject> list = rtPartMapper.queryPartIbaByList(featureVOS, vo.getBeginTime(), vo.getEndTime());
        dto.setResult("true");
        dto.setSuccess("true");
        dto.setMessageBoxicon("查询成功");
        dto.setTime(String.valueOf(new Date()));
        dto.setData(list);
        return dto;
    }

    @Override
    public DesignDerivationDTO verifyDesignDerivation(String drawingCode) {
        if(StringUtils.isBlank(drawingCode)){
            throw RTErrorCodeEnum.DRAWING_CODE_NAME_ERROR.getException("drawingCode参数为空");
        }
        DesignDerivationDTO dto = new DesignDerivationDTO();
        dto.setNewDrawingCode(drawingCode);
        getDrawingCode(drawingCode, dto);
        if(StringUtils.isNotBlank(dto.getOldDrawingCode())&&StringUtils.isNotBlank(dto.getNewDrawingCode())&&dto.getOldDrawingCode().equals(dto.getNewDrawingCode())){
            return new DesignDerivationDTO();
        }
        return dto;
    }

    private void getDrawingCode(String drawingCode,DesignDerivationDTO dto) {
        PartDO partDO = rtPartMapper.queryLatestPartByNumberAndView(drawingCode.trim(), RTPlmConstant.VIEW_DESIGN, "");
        if(ObjectUtils.isEmpty(partDO)){
            throw RTErrorCodeEnum.DRAWING_CODE_NAME_ERROR.getException("未找到编码为:"+ drawingCode +"的图号");
        }
        Map<String, List<AttributeVO>> attrValueByOidAndKeys = typlmAttributeValueService.getIbaAttrValueByOidAndKeys(
                Collections.singletonList(partDO.getOid()),
                TableTypeConstrant.TY_PART_OTYPE,
                Collections.singletonList(RTPlmConstant.DESIGN_DERIVATION));
        dto.setOldDrawingCode(drawingCode);
        if(CollUtil.isNotEmpty(attrValueByOidAndKeys)){
            List<AttributeVO> attributeVOS = attrValueByOidAndKeys.get(String.valueOf(partDO.getOid()));
            AttributeVO attributeVO = attributeVOS.get(0);
            log.info("属性值:{}",attributeVO.getAttributeValue());
            String attributeValue = attributeVO.getAttributeValue();
            if(StringUtils.isNotBlank(attributeValue)){
                getDrawingCode(attributeValue,dto);
            } else {
                dto.setOldDrawingCode(attributeValue);
                dto.setMsg(dto.getNewDrawingCode()+"设计衍生属性为:"+attributeValue+"是否应用"+attributeValue);
            }
        }else {
            dto.setOldDrawingCode(dto.getOldDrawingCode());
            dto.setMsg(dto.getNewDrawingCode()+"设计衍生属性为:"+dto.getOldDrawingCode()+"是否应用"+dto.getOldDrawingCode());
        }
    }

    @Override
    public void updatePartDescription(String workFlowContainerId) {
        WorkFlowContainerView workFlowContainerView = typlmWorkFlowContainerService.getWorkFlowContainerDetailByPrimaryKey(
                new BigInteger(workFlowContainerId));
        if (workFlowContainerView instanceof FlowChgFormView) {
            log.info("当前流程属于变更流程/发布流程");
            FlowChgFormView flowChgFormView = (FlowChgFormView) workFlowContainerView;
            List<ECObjData> flowObjectList = flowChgFormView.getChgFormVO().getEcAffectVOS();
            List<BigInteger> partIds = flowObjectList.stream().filter(
                    ecObjData -> TableTypeConstrant.TY_PART_OTYPE.equals(ecObjData.getRefObjectOtype())).map(ECObjData::getRefObjectOid).collect(
                    Collectors.toList());
            Map<String, List<AttributeVO>> attrValueByOidAndKeys = typlmAttributeValueService.getIbaAttrValueByOidAndKeys(
                    partIds,
                    TableTypeConstrant.TY_PART_OTYPE,
                    Collections.singletonList(RTPlmConstant.DESIGN_DERIVATION));
            List<TyPartAllVO> tyPartAllVOS = typlmPartService.queryPartAllVOList(partIds);
            List<SaveObjIBADTO> objWithIbaList = new ArrayList<>();
            for (TyPartAllVO tyPartAllVO : tyPartAllVOS) {
                BigInteger oid = tyPartAllVO.getOid();
                BigInteger classificationOid = tyPartAllVO.getClassificationOid();
                List<AttributeVO> attributeVOS = attrValueByOidAndKeys.get(oid.toString());
                Map<String, List<String>> partIbaMap = attributeVOS.stream()
                        .collect(Collectors.groupingBy(
                                AttributeVO::getAttributeName,
                                Collectors.mapping(AttributeVO::getAttributeValue, Collectors.toList())
                        ));
                GenerateDescriptionRuleDto dto = new GenerateDescriptionRuleDto();
                dto.setClassId(classificationOid.toString());
                dto.setIbaMap(partIbaMap);
                String typeName = tyPartAllVO.getTypeName();
                if("MaterialCode".equals(typeName)){
                    dto.setIsMaterial("true");
                }else {
                    dto.setIsMaterial("false");
                }
                dto.setType(typeName);
                DescriptionVO descriptionVO = codeSequenceService.generateDescriptionRule(dto, Boolean.TRUE);
                String description = descriptionVO.getIbaDescription();
                String systemDescription = descriptionVO.getSystemDescription();

                SaveObjIBADTO saveObjIBADTO = new SaveObjIBADTO();
                CTyEntityBaseDO cTyEntityBaseDO = new CTyEntityBaseDO(oid, TableTypeConstrant.TY_PART_OTYPE);
                saveObjIBADTO.setCTyEntityBaseDO(cTyEntityBaseDO);
                List<IbaDTO> ibaDTOList = new ArrayList<>();
                IbaDTO ibaDTO = new IbaDTO();
                ibaDTO.setKey("Description");
                ibaDTO.setValue(description);
                ibaDTOList.add(ibaDTO);
                saveObjIBADTO.setObjIbaList(ibaDTOList);
            }
            typlmAttributeValueService.batchSaveIBAByObjsNoConstraint(objWithIbaList, false);
        }
    }


//    @Override
//    @Transactional(rollbackFor = Exception.class)
//    public void quicklyGenerateMaterialCode(BigInteger workFlowContainerId) {
//        WorkFlowContainerView workFlowContainerView = typlmWorkFlowContainerService.getWorkFlowContainerDetailByPrimaryKey(
//                workFlowContainerId);
//        if (workFlowContainerView instanceof WorkFlowObjectPackage) {
//            WorkFlowObjectPackage workFlowObjectPackage = (WorkFlowObjectPackage) workFlowContainerView;
//            List<FlowObject> flowObjectList = workFlowObjectPackage.getFlowObjectList();
//            List<FlowObject> partList = flowObjectList.stream().filter(
//                    flowObject -> TableTypeConstrant.TY_PART_OTYPE.equals(flowObject.getRefObjectOtype()))
//                    .filter(flowObject -> "图样代号".equals(flowObject.getType())).collect(Collectors.toList());
//            if(CollUtil.isNotEmpty(partList)){
//                BigInteger typeOid = rtTypeClassMapper.queryTypeOidByName(MATERIAL_TYPE);
//                List<BigInteger> partOidList = partList.stream().map(FlowObjectPackageLink::getRefObjectOid).collect(
//                        Collectors.toList());
//                Map<String, List<AttributeVO>> partIbaAttrs = typlmAttributeValueService.getAttrValueTableByEntitys(
//                        partOidList, TableTypeConstrant.TY_PART_OTYPE);
//                for (FlowObject flowObject : partList) {
//                    Optional<AttributeVO> firstAttributeVO = flowObject.getIbaAttrs().stream()
//                            .filter(ibaAttr -> "IsGenerateMaterialCode".equals(ibaAttr.getAttributeEnName())
//                                    && ("1".equals(ibaAttr.getAttributeValue()) || "1".equals(ibaAttr.getAttributeValuex())))
//                            .findFirst();
//                    if (firstAttributeVO.isPresent()) {
//                        String patternCode = flowObject.getRefObjectNumber();
//                        FlexibleMatchDTO dto = new FlexibleMatchDTO();
//                        dto.setPatternCode(patternCode);
//                        dto.setType("物料码");
//                        ClassificationDTO classificationD0 = rtAttributeCardService.flexibleMatch(dto);
//                        if (ObjectUtils.isNotEmpty(classificationD0)) {
//                            List<TyAttributeDefMapVO> attrDefMapList = this.typlmTypeService.queryInheritAttrDef(
//                                    classificationD0.getOid(), classificationD0.getOtype());
//                            LinkedHashMap<String, List<String>> ibaAttrMap = new LinkedHashMap<>();
//                            for (TyAttributeDefMapVO tyAttributeDefMapVO : attrDefMapList) {
//                                TyplmDefaultValueParamDTO typlmDefaultValueParamDTO = new TyplmDefaultValueParamDTO();
//                                typlmDefaultValueParamDTO.setEntity(
//                                        new IdentifierEntity(tyAttributeDefMapVO.getOid(),
//                                                             TableTypeConstrant.TY_ATTRIBUTE_DEF_MAP_OTYPE));
//                                typlmDefaultValueParamDTO.setContext(
//                                        new IdentifierEntity(classificationD0.getOid(), TableTypeConstrant.TY_CLASSIFICATION_OTYPE));
//                                Map<String, TyplmDefaultValueParamDTO> defaultValueParamMap = new HashMap<>();
//                                defaultValueParamMap.put(TableTypeConstrant.TY_CLASSIFICATION_OTYPE + ":" + classificationD0.getOid(),
//                                                         typlmDefaultValueParamDTO);
//                                //查询默认值
//                                Map<String, List<TyplmAttrDefaultValueDTO>> entityDefaultValueList = this.typlmDefaultValueService.getEntityDefaultValueList(
//                                        defaultValueParamMap);
//                                List<String> defaultValues = entityDefaultValueList.values().stream()
//                                        .flatMap(List::stream)
//                                        .map(TyplmAttrDefaultValueDTO::getDefaultValue)
//                                        .filter(Objects::nonNull)
//                                        .collect(Collectors.toList());
//                                ibaAttrMap.put(tyAttributeDefMapVO.getName(), defaultValues);
//                            }
//                            ibaAttrMap.put("PatternCode",Collections.singletonList(flowObject.getRefObjectNumber()));
//                            InsertPartDTO insertPartDTO = new InsertPartDTO();
//                            if (partIbaAttrs.containsKey(String.valueOf(flowObject.getRefObjectOid()))) {
//                                List<AttributeVO> attributeVOS = partIbaAttrs.get(String.valueOf(flowObject.getRefObjectOid()));
//                                for (AttributeVO attributeVO : attributeVOS) {
//                                    String value = StringUtils.isBlank(attributeVO.getAttributeValuex()) ? attributeVO.getAttributeValue()
//                                            : attributeVO.getAttributeValuex();
//                                    if("CompleteDescription".equals(attributeVO.getAttributeEnName())){
//                                        // 图样代号完整描述
//                                        ibaAttrMap.put("Common_Attributes|1757215074349", Collections.singletonList(value));
//                                    } else if("Description".equals(attributeVO.getAttributeEnName())){
//                                        // 图样代号拼接描述
//                                        ibaAttrMap.put("PatternCodeDescription", Collections.singletonList(value));
//                                    } else {
//                                        ibaAttrMap.put(attributeVO.getAttributeEnName(),Collections.singletonList(value));
//                                    }
//                                }
//                            }
//                            GenerateDescriptionRuleDto generateDescriptionRuleDto = new GenerateDescriptionRuleDto();
//                            generateDescriptionRuleDto.setClassId(classificationD0.getOid().toString());
//                            generateDescriptionRuleDto.setIbaMap(ibaAttrMap);
//                            generateDescriptionRuleDto.setIsMaterial("true");
//                            DescriptionVO descriptionVO = codeSequenceService.generateDescriptionRule(generateDescriptionRuleDto, Boolean.TRUE);
//
//                            // 获取图样代号描述
//                            String drawingCodeTotalDescription = getAttributeValue(ibaAttrMap, "Common_Attributes|1757215074349");
//                            String drawingCodeSplitDescription = getAttributeValue(ibaAttrMap, "PatternCodeDescription");
//
//                            // 构建物料码描述
//                            String materialCodeTotalDescription = descriptionVO.getSystemDescription();
//                            String materialCodeSplitDescription = descriptionVO.getIbaDescription();
//
//                            if (StringUtils.isNotBlank(drawingCodeTotalDescription)) {
//                                materialCodeTotalDescription =  drawingCodeSplitDescription+ ";" + materialCodeTotalDescription;
//                            }
//                            if (StringUtils.isNotBlank(drawingCodeSplitDescription)) {
//                                materialCodeSplitDescription = drawingCodeSplitDescription + ";" + materialCodeSplitDescription;
//                            }
//
//                            // 设置描述属性
//                            ibaAttrMap.put("MaterialCodeDescription", Collections.singletonList(materialCodeTotalDescription));
//                            ibaAttrMap.put("Description", Collections.singletonList(materialCodeSplitDescription));
//                            insertPartDTO.setIbaAttribute(ibaAttrMap);
//                            insertPartDTO.setTypeOid(String.valueOf(typeOid));
//                            insertPartDTO.setClassId(classificationD0.getOid());
//                            insertPartDTO.setTypeOType(MATERIAL_TYPE);
//                            insertPartDTO.setPartView(flowObject.getView());
//                            insertPartDTO.setName(flowObject.getRefObjectName());
//                            insertPartDTO.setEnditem(0L);
//                            insertPartDTO.setLifecycleState("Creating");
//                            //----------------------------------------------------------------------
//                            ObjectStorageDO objectStorageDO = objectStorageService.selectOneByTypeDefName("物料码");
//                            if(objectStorageDO!=null){
//                                PDFProjectVO v = storagePlanningMapper.selectPdmIds(objectStorageDO.getContextName());
//                                String[] split = objectStorageDO.getFolderPath().split("/");
//                                String folderId = null;
//                                if (objectStorageDO != null) {
//                                    for (int i = 0; i < split.length; i++) {
//                                        String id=null;
//                                        if (StrUtil.isBlank(split[i])) {
//                                            continue;
//                                        }
//                                        if (i==1){
//                                            id=storagePlanningMapper.selectOidByNameAndCid(v.getOId(),
//                                                                                           split[i],"0");
//                                            if (StrUtil.isNotBlank(id)) {
//                                                folderId=id;
//                                            }
//                                        }else {
//                                            id = storagePlanningMapper.selectOidByNameAndCid(v.getOId(), split[i], folderId);
//                                            if (StrUtil.isNotBlank(id)) {
//                                                folderId=storagePlanningMapper.selectOidByNameAndCid(v.getOId(),
//                                                                                                     split[i],folderId);
//                                            }
//
//                                        }
//                                        if (StrUtil.isBlank(id)){
//                                            //创建文件夹
//                                            SubfolderVO subfolder=new SubfolderVO();
//                                            subfolder.setName(split[i]);
//                                            subfolder.setDescription("--系统自动创建--文件夹--");
//                                            subfolder.setParentOid(i==1?v.getDefaultcabinetoid():folderId);
//                                            subfolder.setParentOtype(i==1?"ty.inteplm.folder.CTyCabinet":"ty.inteplm.folder.CTySubFolder");
//                                            SubfolderWebVO subfolderWebVO = typlmSubFolderLinkService.createSubfolder(subfolder);
//                                            folderId=subfolderWebVO.getOid();
//                                        }
//                                    }
//                                    insertPartDTO.setFolderId(folderId);
//                                    insertPartDTO.setContainerID(v.getOId());
//                                    insertPartDTO.setFolderPath(objectStorageDO.getFolderPath());
//                                    insertPartDTO.setContainerName(objectStorageDO.getContextName());
//                                    insertPartDTO.setContainerType("ty.inteplm.product.CTyPDMLinkProduct");
//                                    insertPartDTO.setProductID(v.getOId());
//                                }
//                            }
//                            //------------------------------------------------------------------------
//                            typlmPdmPartService.insertPart(new UploadFileDTO(), new LinkedHashMap<>(),
//                                                           insertPartDTO);
//                        }
//                    }
//                }
//            }
//        }
//    }

    private String getAttributeValue(LinkedHashMap<String, List<String>> ibaAttribute, String key){
        return ibaAttribute.containsKey(key) && CollUtil.isNotEmpty(ibaAttribute.get(key)) ? ibaAttribute.get(key).get(0) : "";
    }

    @Override
    public void checkPartIfExistPublishVersion(List<JSONObject> params) {
        List<JSONObject> partList = params.stream().filter(
                item -> TableTypeConstrant.TY_PART_OTYPE.equals(item.getString("otype"))).collect(Collectors.toList());
        if(CollUtil.isEmpty(partList)){
            throw RTErrorCodeEnum.COMPLETE_DRAW_ERROR.getException("请选择零部件类型的对象");
        }
        List<String> partNumber = new ArrayList<>();
        for (JSONObject part : partList) {
            String number = part.getString("number");
            String view = part.getString("view");
            PartDO partDO = rtPartMapper.queryLatestPartByNumberAndView(number, view, RTPlmConstant.STATE_RELEASED);
            if(partDO==null){
                partDO = rtPartMapper.queryLatestPartByNumberAndView(number, view, "EffectiveNot");
                if(partDO==null){
                    partNumber.add(number);
                }
            }
        }
        if(CollUtil.isNotEmpty(partNumber)){
            String numbers = String.join(",", partNumber);
            throw RTErrorCodeEnum.COMPLETE_DRAW_ERROR.getException("以下下零部件不存在已生效或生效未出图版本的版本："+numbers + "无法选择！");
        }
    }

//    @Override
//    public String queryPartIdByNumber(String number) {
//        return rtPartMapper.queryPartIdByNumber(number);
//    }

//    @Override
//    public String queryPartIdByMasterNumber(String number) {
//        return rtPartMapper.queryPartIdByMasterNumber(number);
//    }


    @Override
    public void collectMaterialCodeIntoFlow(BigInteger workFlowContainerId) {
        WorkFlowContainerView workFlowContainerView = typlmWorkFlowContainerService.getWorkFlowContainerDetailByPrimaryKey(
                workFlowContainerId);
        if (workFlowContainerView instanceof WorkFlowObjectPackage) {
            WorkFlowObjectPackage workFlowObjectPackage = (WorkFlowObjectPackage) workFlowContainerView;
            List<FlowObject> flowObjectList = workFlowObjectPackage.getFlowObjectList();
            List<FlowObject> partList = flowObjectList.stream().filter(
                            flowObject -> TableTypeConstrant.TY_PART_OTYPE.equals(flowObject.getRefObjectOtype()))
                    .filter(flowObject -> "图样代号".equals(flowObject.getType())).collect(Collectors.toList());
            if (CollUtil.isNotEmpty(partList)) {
                List<String> codeNumbers = partList.stream().map(FlowObjectPackageLink::getRefObjectNumber).collect(
                        Collectors.toList());
                List<PartDO> partDOS = rtPartMapper.batchQueryLatestMaterialByViewAndViewState(codeNumbers, "Design",null, "MaterialCode");
                if (CollUtil.isNotEmpty(partDOS)) {
                    List<BaseObject> result = partDOS.stream().map(partDO -> new BaseObject(partDO.getOid(), partDO.getOtype())).collect(Collectors.toList());
                    addIntoWorkFlow(workFlowObjectPackage.getWorkFlowId(), workFlowObjectPackage.getOid(), result, flowObjectList);
                }

            }
        }
    }

    private void addIntoWorkFlow(BigInteger workFlowId, BigInteger containerId, List<BaseObject> objList, List<FlowObject> flowObjectList) {
        FlowObjectStructuredParamVO flowObjectStructuredParamVO = new FlowObjectStructuredParamVO();
        flowObjectStructuredParamVO.setObjList(objList);
        flowObjectStructuredParamVO.setWorkFlowId(workFlowId);
        flowObjectStructuredParamVO.setWorkFlowContainerId(containerId);
        flowObjectStructuredParamVO.setRootObjList(flowObjectList);
        flowObjectStructuredParamVO.setOirAllObjList(flowObjectList);
        flowObjectStructuredParamVO.setSaveDataBase(true);
        this.typlmWorkFlowObjectPackageService.addCheckWorkFlowStartNoThrowCommon(flowObjectStructuredParamVO);
    }
}
